<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{mix('/js/web/frame/jedate/skin/jedate.css')}}">
    <script src="{{mix('/js/web/frame/jedate/jquery.jedate.js')}}"></script>
    <link rel="stylesheet" href="{{mix('/css/web/user/receivables_list.css')}}">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.seller_nav')
        <div class="nav_right flr">
            <div class="base_content">
                <div class="line_title">我的收款</div>
                <div class="my-subnav f-cb">
                    <ul>
                        <li @if(array_get($search_params, 'receivable_type') == null)class="cur" @endif>
                            <a href="/member/seller/receives" class="jm_hover">
                                全部收款
                            </a><i></i>
                        </li>
                        <li @if(array_get($search_params, 'receivable_type') == 2) class="cur" @endif>
                            <a href="/member/seller/receives?receivable_type=2" class="jm_hover">
                                已收款
                            </a><i></i>
                        </li>
                        <li @if(array_get($search_params, 'receivable_type') == 1) class="cur" @endif>
                            <a href="/member/seller/receives?receivable_type=1" class="jm_hover">
                                未收款
                            </a><i></i>
                        </li>
                    </ul>
                </div>
                <div class="marryst">
                    <form action="" method="get">
                        <span>下单时间</span>
                        <input name="created_at[start]" class="datainp" id="inpstart" type="text" placeholder="开始日期" readonly="" value="{{array_get($search_params, "created_at.start")}}">
                        <span>至</span>
                        <input name="created_at[end]" class="datainp" id="inpend" type="text" placeholder="结束日期" readonly="" value="{{array_get($search_params, "created_at.end")}}">
                        <input type="hidden" name="receivable_type" value="{{array_get($search_params, 'receivable_type')}}">
                        <input type="submit" class="buttonn" value="查询">
                    </form>
                </div>

                <div class="table">
                    <table>
                        <thead>
                        <tr>
                            <th width="180">订单编号</th>
                            <th width="120">下单时间</th>
                            <th width="120">收款时间 </th>
                            <th width="260">订单商品</th>
                            <th>数量</th>
                            <th>金额</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            @if(isset($list))
                                @foreach($list as $key=>$order)
                                    <tr>
                                        <td>{{$order['order_code']}}</td>
                                        <td>{{date('Y/m/d',strtotime($order['created_at']))}}</td>
                                        <td>
                                            @if(isset($order['receivable_at'])&&$order['receivable_at']!==null)
                                                {{date('Y/m/d',strtotime($order['receivable_at']))}}
                                            @else
                                                -
                                            @endif
                                        </td>
                                        <td>
                                            @foreach($order['order_products'] as $k=>$orderPro)
                                            <p>{{$orderPro['product_name']}}</p>
                                            @endforeach
                                        </td>
                                        <td>
                                            × {{array_sum(array_column($order['order_products'],'quantity'))}}
                                        </td>
                                        <td><label class="jm_error">￥{{$order['order_money']}}</label></td>
                                        <td><a href="/member/seller/orders/{{$order['id']}}" target="_blank">订单详情</a></td>
                                    </tr>
                                @endforeach
                            @else
                                <p class="text-center">暂无数据</p>
                            @endif
                        </tbody>
                    </table>
                </div>
                <div class="page">
                    @include('web.common.paginate')
                </div>
            </div>
        </div>
    </div>
</div>
<div class="bg_h"></div>


@include('web.layout.footer')
<script type="text/javascript">
    var start = {
        format: 'YYYY-MM-DD hh:mm',
        minDate: '2014-06-16 23:59:59', //设定最小日期为当前日期
        //festival:true,
        maxDate: $.nowDate({DD:0}), //最大日期
        choosefun: function(elem,datas){
            end.minDate = datas; //开始日选好后，重置结束日的最小日期
            endDates();
        },
        okfun:function (elem,datas) {
            alert(datas)
        }
    };
    var end = {
        format: 'YYYY-MM-DD hh:mm',
        minDate: $.nowDate({DD:0}), //设定最小日期为当前日期
        //festival:true,
        maxDate: '2099-06-16 23:59:59', //最大日期
        choosefun: function(elem,datas){
            start.maxDate = datas; //将结束日的初始值设定为开始日的最大日期
        }
    };
    function endDates() {
        end.trigger = false;
        $("#inpend").jeDate(end);
    }
    $("#inpstart").jeDate(start);
    $("#inpend").jeDate(end);

    $(function(){

    });

</script>
</body>
</html>